/*
 * @Author: your name
 * @Date: 2021-03-07 17:11:32
 * @LastEditTime: 2021-05-02 16:40:44
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \learn-fe\learn-small-program\components\dishCard\index.js
 */
Component({
  properties: {
    dishName: {
      type: String,
      value: "菜名",
    },
    dishCover: {
      type: String,
      value: "../../static/images/cover1.png",
    },
    address: {
      type: String,
      value: "天府三街",
    },
    distance: {
      type: Number,
      value: 100,
    },
    dishId: {
      type: Number,
      value: 1,
    },
    phone: {
      type: Number,
      value: 17888887787,
    },
    tags: {
      type: Array,
      value: [
        {
          id: 1,
          dishId: 11,
          tagName: "好吃",
        },
        {
          id: 2,
          dishId: 12,
          tagName: "不贵",
        },
        {
          id: 3,
          dishId: 13,
          tagName: "便宜",
        },
        {
          id: 4,
          dishId: 14,
          tagName: "实惠",
        },
      ],
    },
  },
  methods: {
    gotoDetail() {
      console.log(this.data.dishId); // properties里的属性最后都会去到this.data里面
    },
    onTap: function () {
      this.triggerEvent("onTapCard", this.data);
    },
  },
  options: {
    styleIsolation: "isolated",
  },
});
